Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve styled configuration references for extension's documentation #1002

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

jdknight
Copy link
Member

With reStructuredText/Sphinx, there does not appear to be a way to take advantage of the :ref: role and apply a literal style processing on select elements. This extension's documentation would handle this by first adding a literal description of an element, followed by a reference named "ref" -- not ideal.

This change adds a custom domain/role to support a lref role, the "literal-styled reference" role. For generated references using this role, they will be manipulated/forwarded to Sphinx's standard domain to handle as a normal cross reference. When resolved, the custom domain will then wrap the inner node with a literal node. This allows both having a page-to-page reference that is also styled as a literal.

Updating various links to use this capability. In addition, cleanup other links/literals that can take advantage of this role.

With reStructuredText/Sphinx, there does not appear to be a way to take
advantage of the `:ref:` role and apply a literal style processing on
select elements. This extension's documentation would handle this by
first adding a literal description of an element, followed by a reference
named "ref" -- not ideal.

This change adds a custom domain/role to support a `lref` role, the
"literal-styled reference" role. For generated references using this
role, they will be manipulated/forwarded to Sphinx's standard domain to
handle as a normal cross reference. When resolved, the custom domain
will then wrap the inner node with a literal node. This allows both
having a page-to-page reference that is also styled as a literal.

Signed-off-by: James Knight <james.d.knight@live.com>
With the recently supported lref role [1], updating various links to
use this capability. In addition, cleanup other links/literals that can
take advantage of this role.

[1]: 71f6bb9

Signed-off-by: James Knight <james.d.knight@live.com>
@jdknight jdknight merged commit 3efac36 into main Jun 29, 2024
2 checks passed
@jdknight jdknight deleted the improve-doc-cfg-references branch June 29, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant